home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / titans / star.swf / scripts / frame_14 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  55 lines

  1. onenterframe = function()
  2. {
  3.    r.posnow += -0.4 * r.bgspeed;
  4.    if(r.enemy.length > 0)
  5.    {
  6.       if(r.posnow > r.enemy[0].x)
  7.       {
  8.          r.attachmovie(r.enemy[0].name,"e" + r.ed,r.ed);
  9.          var en = r["e" + r.ed];
  10.          en._x = screenwid + 100;
  11.          en._y = r.enemy[0].y;
  12.          en.group = r.enemy[0].group;
  13.          r.ed = r.ed + 1;
  14.          r.enemy.splice(0,1);
  15.       }
  16.    }
  17.    if(!r.hit and r.noshot == 0)
  18.    {
  19.       r.shootingani = 1;
  20.       r.zblast1.start();
  21.       if(r.shotsize <= 110)
  22.       {
  23.          r.attachmovie("blast","blast" + r.b,r.b);
  24.       }
  25.       else
  26.       {
  27.          r.attachmovie("blast2","blast" + r.b,r.b);
  28.          r["blast" + r.b]._xscale = 1.5 * r.shotsize;
  29.          r["blast" + r.b]._yscale = 1.5 * r.shotsize;
  30.          r.shotsize = 100;
  31.          r.zblast2.start();
  32.       }
  33.       r["blast" + r.b]._x = s._x + 50;
  34.       r["blast" + r.b]._y = s._y + 2;
  35.       r.bul.push("blast" + r.b);
  36.       r.b = r.b + 1;
  37.    }
  38.    if(r.noshot < 1)
  39.    {
  40.       r.noshot--;
  41.    }
  42.    if(r.autofire)
  43.    {
  44.       if(r.noshot < -4)
  45.       {
  46.          r.noshot = 0;
  47.       }
  48.    }
  49.    if(r.inv > 0)
  50.    {
  51.       r.inv--;
  52.    }
  53. };
  54. stop();
  55.